'use strict';
var Schema = require('mongoose').Schema,
    Model = require('../../../Base/server/controllers/Model');

var modelField = {};

//入库明细行记录
modelField.PendingBusiness={
    type: Schema.ObjectId,
    ref: 'PendingBusiness',
    Name: '待处理业务头',
    IsEmpty: false
};

//行号
modelField.DocLineNum={
    type: String,
    trim: true
}

//料品
modelField.ItemCode={
    type: String,
    trim: true
}

//料品名称
modelField.ItemName={
    type: String,
    trim: true
}

//项目号
modelField.ProjectCode = {
    type: String,
    trim: true
};

//Lot，批号编码
modelField.LotCode = {
    type: String,
    trim: true
};

//番号
modelField.SeiBanCode = {
    type: String,
    trim: true
};
//存储地点
modelField.WhCode = {
    type: String,
    trim: true
};
//库位
modelField.BinCode = {
    type: String,
    trim: true
};
//数量
modelField.Qty={
    type: Number
};
//等级
modelField.DegreeCode = {
    type: String,
    trim: true
};
//成分
modelField.ElementCode = {
    type: String,
    trim: true
};

//厂牌编码
modelField.SupplierCode = {
    type: String,
    trim: true
};

//厂牌名称
modelField.SupplierName = {
    type: String,
    trim: true
};

//存储类型: 0: 待检 1，可用  2，报废; 3 不合格
modelField.StoreType = {
    type: Number,
    default: -1
};

//条码
modelField.BarCode = {
    type: String,
    trim: true
};

//货主组织名称
modelField.ItemOwnOrgName = {
    type: String,
    trim: true
};


var newModel = new Model(modelField);
newModel.addIndex({PendingBusiness: 1});
newModel.create('PendingBusinessDetail', '待处理单据行');
